package com.mql.onlinechatsystem.system.controller;

import com.alibaba.fastjson.JSONObject;
import com.mql.onlinechatsystem.system.service.ITbUserrelationService;
import com.mql.onlinechatsystem.system.vo.SysUserRelationVo;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 马庆林
 * @since 2023-03-08
 */
@Api(tags = "用户关系表")
@RestController
@RequestMapping("/system/tbUserrelation")
@CrossOrigin
public class TbUserrelationController {
    @Autowired
    private ITbUserrelationService iTbUserrelationService;
    @GetMapping("/getFriendRelation")
    public JSONObject getFriendRelation(@RequestParam String userid){
        JSONObject result=new JSONObject();
        List<SysUserRelationVo> sysUserRelationVos=iTbUserrelationService.getFriendRelation(userid);
        result.put("code",200);
        result.put("message","查询成功！");
        result.put("data",sysUserRelationVos);
        return result;
    }
}
